import http from "@/api/config/http";
import { IQuery } from "@/interface/IAxios";

export interface AppCarousel {
  id: string;
  picture: string;
  link: string;
  linkTarget: string;
  beginTime: string;
  endTime: string;
  enable: string;
  sort: number;
}
export const listCarousel = (query: IQuery) => {
  return http.request({
    url: `/app/carousel/list`,
    method: "get",
    params: query
  });
};

export const addCarousel = (data: any) => {
  return http.request({
    url: `/app/carousel`,
    method: "post",
    data
  });
};

export const updateCarousel = (data: any) => {
  return http.request({
    url: `/app/carousel`,
    method: "put",
    data
  });
};
export const getCarousel = (id: string) => {
  return http.request({
    url: `/app/carousel/${id}`,
    method: "get"
  });
};
export const deleteCarousel = (id: string) => {
  return http.request({
    url: `/app/carousel/${id}`,
    method: "delete"
  });
};
